final int BLINK_DURATION_MILLIS = 750;

class TextInfo {
  TextInfo(String lineText, int xPos, int yPos, int r, int g, int b) {
    this.lineText = lineText;
    this.xPos = xPos;
    this.yPos = yPos;
    this.r = r;
    this.g = g;
    this.b = b;
  }
  public String lineText;
  public int xPos;
  public int yPos;
  public int r;
  public int g;
  public int b;
}

class Marquee extends WallMode {
  PFont fontA;
  int lastBlink;
  boolean isShowing;
  ArrayList textInfos;
  
  Marquee() {
    textInfos = new ArrayList();
    isShowing = true;
    lastBlink = millis();
    background(0);
    fontA = loadFont("Ziggurat-HTF-Black-32.vlw");
    textFont(fontA, 15);
    
  }
  
  void add(TextInfo textInfo) {
    this.textInfos.add(textInfo);
  }
  
  
  void keyPressed() {
  }
  void modeSelected() {
  }

  int getDisplayTime() {
    return 3;
  }
  void setup() {
  }

  void draw() {
    if((millis() - lastBlink) > BLINK_DURATION_MILLIS) {
      isShowing = !isShowing;
      lastBlink = millis();
    }
    
    if(isShowing) {
      background(0);
      for(int i = 0; i < textInfos.size(); i++) {
        TextInfo thisInfo = (TextInfo)textInfos.get(i);
        fill(thisInfo.r, thisInfo.g, thisInfo.b);
        text(thisInfo.lineText, thisInfo.xPos, thisInfo.yPos);
      }
    }
  }
}

